package com.anzia.reader;

import java.io.FileWriter;

/**
 *@ClassName FileWriter_Demo
 *@Description
 *@Author Anzia.
 *@Date 2021/4/9 16:01
 *@Version 1.0
 **/
public class FileWriter_Demo {

    public static void main(String[] args) throws Exception {

        //创建FileWriter对象
        FileWriter fw = new FileWriter("static\\write.txt");

        //写入
        for (int i = 0; i < 10; i++) {
            fw.write("java是世界上最好的语言\r\n");
            fw.flush();
        }

        //关闭
        fw.close();
        System.out.println("执行完毕！");

    }

}
